package com.handinglian.servicerecord.mapper;

import com.handinglian.servicerecord.dto.MessageIndexDto;
import com.handinglian.servicerecord.entity.MessageRecord;
import com.handinglian.task.dto.TaskUserMessageDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface MessageRecordMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(MessageRecord record);

    int insertOrUpdate(MessageRecord record);

    int insertOrUpdateSelective(MessageRecord record);

    int insertSelective(MessageRecord record);

    MessageRecord selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(MessageRecord record);

    int updateByPrimaryKey(MessageRecord record);

    int updateBatch(List<MessageRecord> list);

    int batchInsert(@Param("list") List<MessageRecord> list);

    List<MessageRecord> find(@Param("userIds") List<Integer> userIds, @Param("userName") String userName, @Param("customerNameOrPhone") String customerNameOrPhone, @Param("titleOrContent") String titleOrContent, @Param("startDate") Date starDate, @Param("endDate") Date endDate, @Param("sortField")String sortField, @Param("sortOrder")String sortOrder);

    List<MessageIndexDto> countMessageRecord(@Param("startDate") Date startDate, @Param("endDate") Date endDate);

    List<TaskUserMessageDto> findByTaskUserId(@Param("taskUserId")Integer taskUserId);
}